import logging
import requests
from api.login_api import Mepsking_Login
from config import Base_Host
class UpdateAddr_Api:
    def updateaddr(self,cityId,token):
        url=Base_Host+'/api/product/shippingTemplate/getShippingAmount?weight=0.456&amount=0.3&cityId={}'.format(cityId)
        print(url)
        header_dict = {"accesstoken": token,"accept-language": "en-US,en;q=0.5"}
        resp=requests.get(url=url,headers=header_dict)
        logging.info('获取到为：{}'.format(resp.json()))
        return resp
if __name__ == '__main__':
    test=UpdateAddr_Api()
    login = Mepsking_Login()
    json_dict = {"account": "2524726232@qq.com", "password": "8c730e7f3dac741443cd3a57cdb7fd8f", "sourceFrom": "PC"}
    token = login.token(json_dict)
    resp=test.updateaddr('1556456269584437249',token)

